export const getUuid = () => {
  return new Date().getTime() + String(parseInt(Math.random() * 100))
}

export const mobileTextExg = (e) => {
  return /^1[3456789]\d{9}$/.test(e)
}
export const setCookie = (name, value) => {
  var Days = 30;
  var exp = new Date();
  exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);

  document.cookie = name + "=" + value + ";path=/";
}
export const getCookie = c_name => {
  if (document.cookie.length > 0) {
    var c_start = document.cookie.indexOf(c_name + "=")
    if (c_start != -1) {
      c_start = c_start + c_name.length + 1
      var c_end = document.cookie.indexOf(";", c_start)
      if (c_end == -1) c_end = document.cookie.length
      return unescape(document.cookie.substring(c_start, c_end))
    }
  }
  return ""
}
